package com.lrkj.back;

import com.lrkj.back.controller.CommonInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * Created by daiwe on 2017/7/12.
 *
 */
@Configuration
public class MyWebAppConfigurer extends WebMvcConfigurerAdapter {

    @Autowired
    private CommonInterceptor commonInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 多个拦截器组成一个拦截器链
        // addPathPatterns 用于添加拦截规则
        // excludePathPatterns 用户排除拦截
        registry.addInterceptor(commonInterceptor).addPathPatterns("/**")
                .excludePathPatterns("/").excludePathPatterns("/recover/recAndroid")
                .excludePathPatterns("/qingxi/cleanoutAndroid")
                .excludePathPatterns("/qingxi/wanglanList")
                .excludePathPatterns("/qingxi/save.do")
                .excludePathPatterns("/qingxi/findwanglanList")
                .excludePathPatterns("/miejun/sterilizeAndroid")
                .excludePathPatterns("/wutiaoma/findHuishouPackageByDepart")
                .excludePathPatterns("/wutiaoma/allDeptList")
                .excludePathPatterns("/wutiaoma/save.do")
                .excludePathPatterns("/miejun/miejunListAndroid")
        .excludePathPatterns("/miejun/miejunSaveAndroid")
        .excludePathPatterns("/miejun/waitShenheAndroid")
        .excludePathPatterns("/miejun/mjLiushuiList")
        .excludePathPatterns("/miejun/updateShenheAndHege.do")
        .excludePathPatterns("/peibao//peibaobaocun.do")
        .excludePathPatterns("/peibao/peibaoListAndroid")
        .excludePathPatterns("/peibao/findQixieByBarCode")
        .excludePathPatterns("/peibao/peibaoshenheBaocun.do")
        .excludePathPatterns("/peibao/guanbaoBaocun.do")
        .excludePathPatterns("/packageIm/findImByBarcode")
        .excludePathPatterns("/packageIm/findImByBarcodeAndroid")
        .excludePathPatterns("/zhuisuPackage/packageingList.do")
                .excludePathPatterns("/zhuisuPackage/findPackList")
        .excludePathPatterns("/packageIm/useData");
        super.addInterceptors(registry);
    }


}
